package com.hzj.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hzj.pojo.Department;
import com.hzj.mapper.DepartmentMapper;
import com.hzj.service.DepartmentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author hzj
 * @since 2021-04-27
 */
@Service
public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Department> implements DepartmentService {
    @Autowired
    DepartmentMapper dm;

    @Override
    public boolean updateAndSave(Department department) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("hoscode", department.getHoscode());
        wrapper.eq("depcode",department.getDepcode());
        return saveOrUpdate(department, wrapper);

    }
}
